<template>
  <div class="content">
    <div v-for="item in 100" :key="item" class="content-item">
      <button @click="clickTap(item)"> 派发给父组件{{ item }}</button>
    </div>

  </div>
</template>

<script lang="ts" setup>
import {reactive} from "vue";

//像外传递事件 和参数
let emite = defineEmits(['on-click'])//注册事件
const clickTap = (val) => {
  emite('on-click', val)//事件传参
}

const contentList = [1, 2, 3]
//像外传递参数
defineExpose({
  contentList
})
</script>

<style lang="less" scoped>
.content {
  flex: 1;
  margin: 20px;
  border: 1px solid #ccc;
  overflow: auto;

  &-item {
    padding: 20px;
    border-bottom: 1px solid #ccc;
  }
}
</style>